package day1.homework.four;

/**
 * @创建人 MBY381
 * @创建时间 2022/6/27 23:32
 * @描述 暂无
 */
public class Student1 implements Comparable<Student1>{
    public String name;
    public int age;
    public float score;

    public Student1(String name, int age, float score) {
        this.name = name;
        this.age = age;
        this.score = score;
    }

    @Override
    public int compareTo(Student1 o) {
        if(o.score==this.score){
            return o.age-this.age;
        }
        return (int)(o.score-this.score);
    }

    @Override
    public String toString(){
        return "Student："+this.name+" age:"+age+" score:"+this.score;
    }
}
